//package com.xqboss.chain.bsn;
//
//import com.alibaba.fastjson2.JSON;
//import com.reddate.wuhanddc.DDCSdkClient;
//import com.reddate.wuhanddc.listener.SignEventListener;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
//import java.math.BigInteger;
//import java.util.ArrayList;
//
//
//@Slf4j
//@Component
//public class BlockEventServiceUtil {
//
////    private String transactionSignature(String sender, RawTransaction transaction) {
////        // sender: Obtain the private key according to the sender and complete its signature
////        //sender privateKey
////        Credentials credentials = Credentials.create(privateKey);
////        byte[] signedMessage = TransactionEncoder.signMessage(transaction, 5555, credentials);
////        return Numeric.toHexString(signedMessage);
////    }
//
//
//    public ArrayList<Object> getBlockEvent(BigInteger blockNum) throws Exception {
//        SignEventListener signEventListener = event -> AuthorityServiceUtil.transactionSignature(event.getSender(), event.getRawTransaction());
//        DDCSdkClient ddcSdkClient = DDCSdkClient.builder().setSignEventListener(signEventListener).build();
//        ArrayList<Object> result = new ArrayList<>();
//        result.addAll(ddcSdkClient.blockEventService.getBlockEvent(blockNum));
//        log.info(blockNum + ",getBlockEvent:::" + JSON.toJSONString(result));
//        return result;
//    }
//}